home *** CD-ROM | disk | FTP | other *** search
/ Professional Soft Collection 1.02 / Professional Soft Collection 1.02.iso / communic / qmodempr / script.pak / SERVICES.SCR < prev    next >
Encoding:
Text File  |  1994-03-01  |  11.6 KB  |  384 lines

  1. '
  2. ' This script is used to automatically create and add new dialing directory
  3. ' entries for online services.
  4. '
  5. ' To use, just run SERVICES.SCR from QmodemPro for Windows.
  6. '
  7.  
  8. declare sub AddCIS
  9. declare sub AddGEnie
  10. declare sub AddMCI
  11.  
  12. const qq = chr(34)
  13.  
  14. dialog ServicesList 6, 15, 194, 110
  15.   caption "Add Online Service"
  16.   groupbox "Services", -1, 8, 9, 178, 68
  17.   cis as radiobutton "CompuServe Information Service", 101, 20, 30, 150, 12
  18.   genie as radiobutton "GEnie", 102, 20, 42, 150, 12
  19.   mci as radiobutton "MCI Mail", 103, 20, 54, 150, 12
  20.   defpushbutton "OK", IDOK, 13, 88, 50, 14
  21.   pushbutton "Cancel", IDCANCEL, 73, 88, 50, 14
  22.   pushbutton "Help", 104, 133, 88, 50, 14
  23. end dialog
  24.  
  25. dialog ServicesHelp 6, 15, 194, 119
  26.   caption "Online Services Help"
  27.   defpushbutton "OK", IDOK, 72, 97, 50, 14
  28.   groupbox "", -1, 4, 4, 185, 86
  29.   ltext "This script is useful for automatically creating", -1, 10, 10, 170, 8
  30.   ltext "dialing directory entries and logon scripts for", -1, 10, 18, 170, 8
  31.   ltext "three of the major online services: CompuServe,", -1, 10, 26, 170, 8
  32.   ltext "GEnie, and MCI Mail.  After selecting an online", -1, 10, 34, 170, 8
  33.   ltext "service, this script will prompt for your user ID,", -1, 10, 42, 170, 8
  34.   ltext "password, or phone number as needed.  Then a phone", -1, 10, 50, 170, 8
  35.   ltext "directory entry will automatically be created for", -1, 10, 58, 170, 8
  36.   ltext "the service you have selected.", -1, 10, 66, 170, 8
  37. end dialog
  38.  
  39. function ServicesList.id(104) as integer
  40.   dim help as ServicesHelp
  41.   dialogbox help
  42. end function
  43.  
  44. dim sl as ServicesList
  45. sl.cis = 1
  46. do
  47.   if dialogbox(sl) <> IDOK then
  48.     exit do
  49.   end if
  50.   if sl.cis then AddCIS
  51.   if sl.genie then AddGEnie
  52.   if sl.mci then AddMCI
  53. loop
  54.  
  55. function GetUniqueScriptName(prefix as string) as string
  56.   dim scrname as string
  57.   scrname = ConfigScriptPath + "\" + prefix + ".scr"
  58.   dim i as integer
  59.   i = 0
  60.   do while exists(scrname)
  61.     i = i + 1
  62.     scrname = ConfigScriptPath + "\" + prefix + str(i) + ".scr"
  63.   loop
  64.   GetUniqueScriptName = scrname
  65. end function
  66.  
  67. '*********************************************************************
  68.  
  69. sub CreateCISCPSScript
  70.   print #1, "striphibit on"
  71.   print #1, "delay 1"
  72.   print #1, "send ";qq;"^C";qq;";"
  73.   print #1, "waitfor ";qq;"User ID: ";qq
  74.   print #1, "send lastconnectuserid"
  75.   print #1, "waitfor ";qq;"Password: ";qq
  76.   print #1, "send lastconnectpassword"
  77. end sub
  78.  
  79. sub CreateCISTELScript
  80.   print #1, "striphibit on"
  81.   print #1, "when match ";qq;"Host Name:";qq;" do send ";qq;"CIS";qq
  82.   print #1, "delay 1"
  83.   print #1, "send ";qq;"@";qq
  84.   print #1, "timeout 5"
  85.   print #1, "try1200:"
  86.   print #1, "waitfor ";qq;"TERMINAL=";qq
  87.   print #1, "timeout off"
  88.   print #1, "send ";qq;"D1";qq
  89.   print #1, "waitfor ";qq;"@";qq
  90.   print #1, "send ";qq;"C 614227";qq
  91.   print #1, "waitfor ";qq;"User ID: ";qq
  92.   print #1, "send lastconnectuserid"
  93.   print #1, "waitfor ";qq;"Password: ";qq
  94.   print #1, "send lastconnectpassword"
  95.   print #1,
  96.   print #1, "catch err_timeout"
  97.   print #1, "send"
  98.   print #1, "goto try1200"
  99. end sub
  100.  
  101. sub CreateCISTYMScript
  102.   print #1, "striphibit on"
  103.   print #1, "when match ";qq;"Host Name:";qq;" do send ";qq;"CIS";qq
  104.   print #1, "delay 2"
  105.   print #1, "send ";qq;"A";qq;";"
  106.   print #1, "waitfor ";qq;"LOG IN";qq
  107.   print #1, "send ";qq;"CML05";qq
  108.   print #1, "waitfor ";qq;"User ID: ";qq
  109.   print #1, "send lastconnectuserid"
  110.   print #1, "waitfor ";qq;"Password: ";qq
  111.   print #1, "send lastconnectpassword"
  112. end sub
  113.  
  114. sub CreateCISDPCScript
  115.   print #1, "striphibit on"
  116.   print #1, "when match ";qq;"Host Name:";qq;" do send ";qq;"CIS";qq
  117.   print #1, "delay 2"
  118.   print #1, "send ";qq;"...";qq
  119.   print #1, "waitfor ";qq;"datapac";qq
  120.   print #1, "send ";qq;"29400138";qq
  121.   print #1, "waitfor ";qq;"User ID: ";qq
  122.   print #1, "send lastconnectuserid"
  123.   print #1, "waitfor ";qq;"Password: ";qq
  124.   print #1, "send lastconnectpassword"
  125. end sub
  126.  
  127. sub CreateCISAKNScript
  128.   print #1, "striphibit on"
  129.   print #1, "when match ";qq;"Host Name:";qq;" do send ";qq;"CIS";qq
  130.   print #1, "delay 2"
  131.   print #1, "send ";qq;"A";qq;";"
  132.   print #1, "waitfor ";qq;"LOG IN";qq
  133.   print #1, "send ";qq;"COMPUSERVE";qq
  134.   print #1, "waitfor ";qq;"User ID: ";qq
  135.   print #1, "send lastconnectuserid"
  136.   print #1, "waitfor ";qq;"Password: ";qq
  137.   print #1, "send lastconnectpassword"
  138. end sub
  139.  
  140. sub CreateCISLATScript
  141.   print #1, "striphibit on"
  142.   print #1, "when match ";qq;"Host Name:";qq;" do send ";qq;"CIS";qq
  143.   print #1, "delay 2"
  144.   print #1, "send ";qq;"...";qq
  145.   print #1, "waitfor ";qq;"please login";qq
  146.   print #1, "send ";qq;".CPS";qq
  147.   print #1, "waitfor ";qq;"User ID: ";qq
  148.   print #1, "send lastconnectuserid"
  149.   print #1, "waitfor ";qq;"Password: ";qq
  150.   print #1, "send lastconnectpassword"
  151. end sub
  152.  
  153. dialog CISInfo 6, 15, 194, 224
  154.   caption "CompuServe Information Service"
  155.   groupbox "User Information", 101, 8, 7, 175, 52
  156.   rtext "Your PIN", -1, 14, 25, 54, 8
  157.   userid as edittext 102, 71, 22, 96, 12
  158.   rtext "Your Password", -1, 14, 41, 54, 8
  159.   password as edittext 103, 71, 38, 96, 12
  160.   groupbox "Connection", 104, 8, 68, 175, 125
  161.   rtext "Phone Number", -1, 14, 84, 54, 8
  162.   number as edittext 105, 71, 81, 96, 12
  163.   pushbutton "View Numbers...", 112, 87, 98, 63, 14
  164.   cps as radiobutton "CompuServe Network", 106, 19, 116, 92, 12
  165.   tel as radiobutton "SprintNet", 107, 19, 128, 92, 12
  166.   tym as radiobutton "Tymnet", 108, 19, 140, 92, 12
  167.   dpc as radiobutton "Canadian Datapac", 109, 19, 152, 92, 12
  168.   akn as radiobutton "AlaskaNet", 110, 19, 164, 92, 12
  169.   lat as radiobutton "LATA", 111, 19, 176, 92, 12
  170.   defpushbutton "OK", 114, 10, 203, 50, 14
  171.   pushbutton "Cancel", IDCANCEL, 70, 203, 50, 14
  172.   pushbutton "Help", 113, 130, 203, 50, 14
  173. end dialog
  174.  
  175. function CISInfo.id(114) as integer
  176.   dim i as integer, seencomma as integer
  177.   for i = 1 to len(userid)
  178.     dim c as string
  179.     c = mid(userid, i, 1)
  180.     if c = "," then
  181.       if seencomma then
  182.         msgbox "Your PIN should be in the format 12345,6789"
  183.         exit function
  184.       else
  185.         seencomma = true
  186.       end if
  187.     elseif c < "0" or c > "9" then
  188.       msgbox "Your PIN should be in the format 12345,6789"
  189.       exit function
  190.     end if
  191.   next i
  192.   i = instr(userid, ",")
  193.   if i <= 1 or i >= len(userid) then
  194.     msgbox "Your PIN should be in the format 12345,6789"
  195.     exit function
  196.   end if
  197.  
  198.   if password = "" then
  199.     msgbox "You need to fill in your password."
  200.     exit function
  201.   end if
  202.  
  203.   if number = "" then
  204.     msgbox "You need to fill in a phone number."
  205.     exit function
  206.   end if
  207.  
  208.   DialogResult = IDOK
  209. end function
  210.  
  211. function CISInfo.id(112) as integer
  212.   if cps then viewfile ConfigScriptPath+"\cisphone.cps"
  213.   if tel then viewfile ConfigScriptPath+"\cisphone.tel"
  214.   if tym then viewfile ConfigScriptPath+"\cisphone.tym"
  215.   if dpc then viewfile ConfigScriptPath+"\cisphone.dpc"
  216.   if akn then viewfile ConfigScriptPath+"\cisphone.akn"
  217.   if lat then viewfile ConfigScriptPath+"\cisphone.lat"
  218. end function
  219.  
  220. sub AddCIS
  221.   dim info as CISInfo
  222.   info.cps = 1
  223.   if dialogbox(info) = IDOK then
  224.     dim scriptname as string
  225.     scriptname = GetUniqueScriptName("cis")
  226.     open scriptname for output as #1
  227.     if info.cps then CreateCISCPSScript
  228.     if info.tel then CreateCISTELScript
  229.     if info.tym then CreateCISTYMScript
  230.     if info.dpc then CreateCISDPCScript
  231.     if info.akn then CreateCISAKNScript
  232.     if info.lat then CreateCISLATScript
  233.     close #1
  234.     dim entry as phoneentry
  235.     entry.systemname = "CompuServe"
  236.     entry.number(1) = info.number
  237.     entry.userid = info.userid
  238.     entry.password = info.password
  239.     entry.scriptfile = scriptname
  240.     entry.emulation = vidtex
  241.     entry.protocol = bplus
  242.     entry.device = "-Default-"
  243.     entry.iconfile = "bbsicons.dll"
  244.     entry.iconid = 2
  245.     addentry entry
  246.     msgbox "Phone directory entry for CompuServe created."
  247.   end if
  248. catch err_fileopen
  249.   msgbox "Could not create script: " + scriptname
  250. end sub
  251.  
  252. '*********************************************************************
  253.  
  254. sub CreateGEnieScript
  255.   print #1, "striphibit on"
  256.   print #1, "duplex off"
  257.   print #1, "delay 2"
  258.   print #1, "send "+qq+"HHH"+qq+";"
  259.   print #1, "waitfor "+qq+"U#="+qq
  260.   print #1, "send lastconnectuserid + "+qq+","+qq+" + lastconnectpassword"
  261. end sub
  262.  
  263. dialog GEnieInfo 6, 15, 194, 127
  264.   caption "GEnie"
  265.   groupbox "User Information", 101, 8, 7, 175, 52
  266.   rtext "Your User ID", -1, 14, 25, 54, 8
  267.   userid as edittext 102, 71, 22, 96, 12
  268.   rtext "Your Password", -1, 14, 41, 54, 8
  269.   password as edittext 103, 71, 38, 96, 12
  270.   groupbox "Connection", 104, 8, 68, 175, 29
  271.   rtext "Phone Number", -1, 14, 84, 54, 8
  272.   number as edittext 105, 71, 81, 96, 12
  273.   defpushbutton "OK", 114, 10, 106, 50, 14
  274.   pushbutton "Cancel", IDCANCEL, 70, 106, 50, 14
  275.   pushbutton "Help", 113, 130, 106, 50, 14
  276. end dialog
  277.  
  278. function GEnieInfo.id(114) as integer
  279.   if userid = "" then
  280.     msgbox "You need to fill in your User ID."
  281.     exit function
  282.   end if
  283.  
  284.   if password = "" then
  285.     msgbox "You need to fill in your password."
  286.     exit function
  287.   end if
  288.  
  289.   if number = "" then
  290.     msgbox "You need to fill in a phone number."
  291.     exit function
  292.   end if
  293.  
  294.   DialogResult = IDOK
  295. end function
  296.  
  297. sub AddGEnie
  298.   dim info as GEnieInfo
  299.   if dialogbox(info) = IDOK then
  300.     dim scriptname as string
  301.     scriptname = GetUniqueScriptName("genie")
  302.     open scriptname for output as #1
  303.     CreateGEnieScript
  304.     close #1
  305.     dim entry as phoneentry
  306.     entry.systemname = "GEnie"
  307.     entry.number(1) = info.number
  308.     entry.userid = info.userid
  309.     entry.password = info.password
  310.     entry.scriptfile = scriptname
  311.     entry.emulation = ansi
  312.     entry.protocol = zmodem
  313.     entry.device = "-Default-"
  314.     entry.iconfile = "bbsicons.dll"
  315.     entry.iconid = 3
  316.     addentry entry
  317.     msgbox "Phone directory entry for GEnie created."
  318.   end if
  319. catch err_fileopen
  320.   msgbox "Could not create script: " + scriptname
  321. end sub
  322.  
  323. '*********************************************************************
  324.  
  325. sub CreateMCIScript
  326.   print #1, "striphibit on"
  327.   print #1, "waitfor "+qq+"your user name:"+qq
  328.   print #1, "send lastconnectuserid"
  329.   print #1, "waitfor "+qq+"Password:"+qq
  330.   print #1, "send lastconnectpassword"
  331. end sub
  332.  
  333. dialog MCIInfo 6, 15, 194, 87
  334.   caption "MCI Mail"
  335.   groupbox "User Information", 101, 8, 7, 175, 52
  336.   rtext "Your User Name", -1, 14, 25, 54, 8
  337.   userid as edittext 102, 71, 22, 96, 12
  338.   rtext "Your Password", -1, 14, 41, 54, 8
  339.   password as edittext 103, 71, 38, 96, 12
  340.   defpushbutton "OK", 114, 10, 65, 50, 14
  341.   pushbutton "Cancel", IDCANCEL, 70, 65, 50, 14
  342.   pushbutton "Help", 113, 130, 65, 50, 14
  343. end dialog
  344.  
  345. function MCIInfo.id(114) as integer
  346.   if userid = "" then
  347.     msgbox "You need to fill in your User ID."
  348.     exit function
  349.   end if
  350.  
  351.   if password = "" then
  352.     msgbox "You need to fill in your password."
  353.     exit function
  354.   end if
  355.  
  356.   DialogResult = IDOK
  357. end function
  358.  
  359. sub AddMCI
  360.   dim info as MCIInfo
  361.   if dialogbox(info) = IDOK then
  362.     dim scriptname as string
  363.     scriptname = GetUniqueScriptName("mci")
  364.     open scriptname for output as #1
  365.     CreateMCIScript
  366.     close #1
  367.     dim entry as phoneentry
  368.     entry.systemname = "MCI Mail"
  369.     entry.number(1) = "1-800-967-9600"
  370.     entry.userid = info.userid
  371.     entry.password = info.password
  372.     entry.scriptfile = scriptname
  373.     entry.emulation = ansi
  374.     entry.protocol = zmodem
  375.     entry.device = "-Default-"
  376.     entry.iconfile = "bbsicons.dll"
  377.     entry.iconid = 4
  378.     addentry entry
  379.     msgbox "Phone directory entry for MCI Mail created."
  380.   end if
  381. catch err_fileopen
  382.   msgbox "Could not create script: " + scriptname
  383. end sub
  384.